<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
function deletedata(p_num){
	if (confirm("정말 삭제하시겠습니까??\n삭제하시게 되면 주차내역이 모두 삭제됩니다.")){    //확인
		location.href='delete.do?p_num='+p_num;
	}
	return false;
}
function downManagerLevel(m_num,m_pknum){
	if (confirm("정말 해임하시겠습니까??")){    //확인
		location.href='managerUpdate.do?m_num='+m_num+'&&m_pknum='+m_pknum;
	}
	return false;
}
</script>
<style type="text/css">
	fieldset {
		width: 388px;
	}
	
	fieldset ul {
		line-height list-style: none;
		padding: 0;
		margin: 2px;
	}
	
	fieldset ul li {
		margin: 0 0 9px 0;
		padding: 0;
	}
	
	fieldset input {
		width: 200px;
	}
	
	input[type="submit"] {
		width: 120px;
		font-family: "맑은 고딕";
	}
	
	input[type="button"] {
		width: 120px;
		font-family: "맑은 고딕";
	}
	
	legend {
		font-family: "맑은 고딕";
		font-size: 20px;
		color: green;
	}
	
	#shadow {
		position: inherit;
		box-shadow: 5px 5px 10px #000;
		-webkit-box-shadow: 5px 5px 10px #000;
		-moz-box-shadow: 5px 5px 10px #000;
	}
	
 	.line{
	 	border-bottom:1px solid red;
 	}
</style>
<table align="center">
<tr>
<td>
<div style="width: 416px;" id="shadow">
<fieldset>
	<input type="hidden" name="m_id" value="${param.m_id }">
	<legend>${parking.p_name } 정보</legend><br>
	<ul>
		<li>
			<label for="name" style="color: navy;">소유자</label>
			<input type="text" size="50" value="${m_name}"style="background-color: #D6D6D6" disabled>
		</li>
		<li>
			<label for="name">주차장 이름</label>
			<input type="text" size="50" value="${parking.p_name }"style="background-color: #D6D6D6" disabled>
		</li>
		<li>
			<label for="name">주소</label>
			<input type="text" size="50" value="${parking.p_addr }"style="background-color: #D6D6D6" disabled>
		</li>
		<li>
			<label for="name">전화번호</label>
			<input type="text" size="50" value="${parking.p_phone }" style="background-color: #D6D6D6" disabled>
		</li>
		<li>
			<label for="name">주차가능대수</label>
			<input type="text" size="50" value="${parking.p_count }"style="background-color: #D6D6D6" disabled>
		</li>
		<li>
			<label for="name">이용단가(단위:분)</label>
			<input type="text" size="50" value="${parking.p_cost }" style="background-color: #D6D6D6" disabled>
		</li>
		<li>
		<div align="center">
		<c:if test="${userLevel>=3}">
			<input type="button" value="삭제" onclick="deletedata(${parking.p_num})" style="width: 120px;height: 22px">
		</c:if>
			<input type="submit" value="수정" onclick="location.href='updateParking.do?p_num=${parking.p_num}&&m_name=${m_name}'" style="width: 120px;height: 22px">
		</div>
		</li>
	</ul>
</fieldset>
</div>
</td>
</tr>
</table>

<c:if test="${not empty list}">
<div id="div2">
	<table border="0" width="800" align="center">
			<tr align="center"> 
				<td colspan="6" style="font-weight: bold;color: navy" class="line">매니저 정보</td>
			</tr>
			<tr>		
				<th class="line">번호</th>
				<th class="line">이름</th>
				<th class="line">핸드폰</th>
				<th class="line">주소</th>
				<th class="line">e-mail</th>
				<th class="line">매니저해임</th>
			</tr>
			<c:forEach var="member" items="${list }" varStatus="status">
				<c:if test="${member.m_resign != 2 }">
				<tr align="center">
					<td width="50" class="line">${status.index+1 }</td>
					<td width="90" class="line">${member.m_name }</td>
					<td width="150" class="line">${member.m_phone }</td>
					<td width="300" class="line">${member.m_address }</td>
					<td width="150" class="line">${member.m_email }</td>
					<td width="120" class="line">
						<c:if test="${userLevel >= 3 }">
							<input type="button" value="매니저해임" style="width: 120px;height: 20px;background-color: yellow;font-weight: bold;color:blue"
								 						onclick="downManagerLevel(${member.m_num},${member.m_pknum })">
						</c:if>
						<c:if test="${userLevel <= 2 }">
							<input type="button" value="매니저해임" style="width: 120px;height: 20px;background-color: gray;font-weight: bold;color: white" disabled="disabled">
						</c:if>
					</td>
				</tr>
				</c:if>
			</c:forEach>
	</table>
</div>
</c:if>